﻿<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>
<!-- saved from url=(0033)http://research.microsoft.com/pex -->
<head><link rel="StyleSheet" href="er.common.css" type="text/css" /><script src="er.common.js" type="text/javascript"> </script><link rel="SHORTCUT ICON" href="favicon.ico" /><link rel="icon" href="favicon.ico" type="image/x-icon" /><title>C:\Users\AO\Documents\Visual Studio 2010\AutomaTones3\automatones\AutomaTones\AutomaTones\View\GUI View\Main.cs</title></head><body><div class="banner"></div><h2 id="top">C:\Users\AO\Documents\Visual Studio 2010\AutomaTones3\automatones\AutomaTones\AutomaTones\View\GUI View\Main.cs</h2><div class="toggle"><p class="copyright"><a class="usercodeundertestcovered">user code under test</a>, 
  <span class="usercodeundertestnotcovered">user code under test (not covered)</span>, 
  <a class="userortestcodecovered">user code or test</a>, 
  <span class="userortestcodenotcovered">user code or test (not covered)</span>,
  <span class="tagged">tagged</span></p><table><tr><th>Methods</th></tr><tr><th /></tr></table><div class="toggle"><a class="button" href="#">first</a><pre class="coverage">/*
 * An implementation of an IMasterView. This view assigns it self with the main controller and will thus
 * work as a main input UI for controller the CA
 * Author: Anders Høst | ahkj@itu.dk
 * date: 13 dec 2010
 * */
using System;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;

namespace AutomaTones.View.GUI_View {
    public partial class Main : UserControl {
        private readonly Assembly _files;
        <a class="userortestcodecovered">public Main()</a> <a class="userortestcodecovered">{</a>
            <a class="userortestcodecovered">InitializeComponent();</a>
            // Gets all the embedded resources and collects them in this assembly.
            <a class="userortestcodecovered">_files = Assembly.GetExecutingAssembly();</a>
            <a class="userortestcodecovered">play.Image = new Bitmap(_files.GetManifestResourceStream("AutomaTones.Graphics.PlayButton.png"));</a>
            <a class="userortestcodecovered">pause.Image = new Bitmap(_files.GetManifestResourceStream("AutomaTones.Graphics.PauseButton.png"));</a>
            <a class="userortestcodecovered">forwards.Image = new Bitmap(_files.GetManifestResourceStream("AutomaTones.Graphics.FastForward.png"));</a>
            <a class="userortestcodecovered">backwards.Image = new Bitmap(_files.GetManifestResourceStream("AutomaTones.Graphics.Backwards.png"));</a>
            <a class="userortestcodecovered">this.BackgroundImage = new Bitmap(_files.GetManifestResourceStream("AutomaTones.Graphics.main.png"));</a>
        <a class="userortestcodecovered">}</a>

        public Action OnPlayButtonClickEvent { get;
            set;
        }

        public Action OnPauseButtonClickEvent { get;
            set;
        }

        public Action OnRewindButtonClickEvent { get;
            set;
        }

        public Action OnForwardButtonClickEvent { get; set; }

        public Action&lt;int&gt; OnVolumeChangeEvent {
            get;
            set;
        }

        private void VolumeChanged(object sender, EventArgs e){
            VScrollBar sc = (VScrollBar)sender;
            OnVolumeChangeEvent.Invoke(sc.Value);
        }

        private void forwardPicClick(object sender, MouseEventArgs e) {
            OnForwardButtonClickEvent.Invoke();
        }

        private void pausePicClick(object sender, MouseEventArgs e) {
            OnPauseButtonClickEvent.Invoke();
        }

        private void playPicclick(object sender, MouseEventArgs e)
        {
            OnPlayButtonClickEvent.Invoke();
        }

        private void back(object sender, MouseEventArgs e) {
            OnRewindButtonClickEvent.Invoke();
        }
    }
}
</pre></div></div><hr /><table width="100%"><tr><td valign="top"><span class="copyright">Copyright (c) Microsoft Corporation. All rights reserved.</span><br /><span class="button" onclick="copySourceToClipboard()">Copy full source to clipboard</span></td></tr></table><div id="debugdiv"> </div></body></html>